diag_log "//________________ GF_Blood_Particle_Bleeding Script _____________";


//by略游重写
fn_addBleeding = {
	params["_target", "_part"];
	private _particle = "#particlesource" createVehicleLocal Position CursorTarget;
	
	 _particle setParticleParams [ 
	 ["\a3\Data_f\ParticleEffects\Universal\Universal", 16, 14, 0, 0],  
	 "", 
	 "Billboard", 
	 0,                  
	 0.5,                  
	 [0,0,0],                
	 [(0.2 - (random 0.4)),(0.2 - (random 0.4)),(0.5 + (random 0.5))],  
	 0.5,//旋转速度 
	 0.5,//一滴水0.05g  
	 0.1,//0.05毫升 
	 0.001,  //空气摩擦系数         
	 [0.05,0.4], //大小变化              
	 [[0.3,0.01,0.01,1],[0.2,0.01,0.01,0]],         
	 [0],                 
	 0,                  
	 0,                
	 "",                  
	 "",                  
	 _particle                
	 ];

	_particle setParticleRandom [ 
	 1,      
	 [0, 0, 0],    
	 [0.1, 0.1, 1.0],  
	 0,      
	0,      
	 [0, 0, 0, 1],   
	 0,      
	 0,      
	 0     
	 ];

	_particle setDropInterval 0.005;  
	
	_particle attachTo [_target,[0,0,0.1], _part];	
	
	_particle spawn{	
		Sleep (5 + random 10);
		deleteVehicle _this;
	};
};

//血雾 快速消失
fn_addBleedingFog ={
	params["_target", "_part"];
	private _particle = "#particlesource" createVehicleLocal Position CursorTarget;
	
	private _particle = "#particlesource" createVehicleLocal (player getPos [3, 0]); 
	 _particle setParticleParams [ 
	 ["\a3\Data_f\ParticleEffects\Universal\Universal", 16, 14, 0, 0],  
	 "", 
	 "Billboard", 
	 0,                  
	 0.75,                  
	 [0,0,0],                
	 [(1.0 - (random 2.0)),(1.0 - (random 2.0)),(1.0 + (random 1.0))],  
	 0,//旋转速度 
	 0.5,//一滴水0.05g  
	 0.1,//0.05毫升 
	 0.001,  //空气摩擦系数         
	 [0.3], //大小变化              
	 [[0.3,0.01,0.01,1],[0.2,0.01,0.01,0]],         
	 [0],                 
	 0,                  
	 0,                
	 "",                  
	 "",                  
	 _particle                
	 ];

	_particle setParticleRandom [ 
	 1,      
	 [0, 0, 0],    
	 [0.1, 0.1, 1.0],  
	 0,      
	0.6,      
	 [0, 0, 0, 1],   
	 0,      
	 0,      
	 0     
	 ];

	_particle setDropInterval 0.01;  
	
	_particle attachTo [_target,[0,0,0.1], _part];	
	
	_particle spawn{	
		uiSleep 0.5;
		deleteVehicle _this;
	};
};
fn_bleeding_event = {
	private _target = _this select 0;
	if(_target getVariable ["as_bleeding_time", 0] > time - 1)exitWith{};
	
	_target setVariable ["as_bleeding_time", time];
	{
		[_target, _x] call fn_addBleedingFog;
		[_target, _x] call fn_addBleeding;
	}forEach (_this select 5);
};

GF_Set_Blood_Particle_Bleeding = {
	_this addEventHandler ["hitpart", {(_this select 0) call fn_bleeding_event}];
};